<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title>欢迎页面</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
{eq name="Request.param.refresh" value="1"}
<meta http-equiv="refresh" content="10" />
{/eq} {include file="public/style" /}
<script type="text/javascript">
          $(document).ready(function(){
        		layui.use(['form','table'], function() {
        			var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
        			//……

        			//但是，如果你的HTML是动态生成的，自动渲染就会失效
        			//因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
        			form.render();
                    form.on("select(auth_type)",function(res){
                    	var id = $(res.elem).attr("data-id");
            			$.ajax({
           				    type : 'post',
           				    url : "{:url('edit')}",
           				    dataType : "json",
           				    data : "status=2&type=" + res.value + "&id=" + id,
           				    success : function(result) {
           				    	layer.msg(result.msg);
           					    window.location.reload();
           				    }
           			    });  
                    })
        		});
          	  var clipboard = new ClipboardJS('#copy',{
                  text: function(trigger) {
                       layer.msg("复制成功！");
                       return trigger.getAttribute('data-text');
                  }
              });
              $(".btnstatus").click(function(){
           	   var id = $(this).attr("data-id");
   			   $.ajax({
				    type : 'post',
				    url : "{:url('edit')}",
				    dataType : "json",
				    data : "type=base&id=" + id + "&status=" +  $(this).attr("data-status"),
				    success : function(result) {
				    	layer.msg(result.msg);
					    window.location.reload();
				    }
			    });           	   
              })
              $(".btnwin").click(function(){
            	  var url = "{:url('Order/msg')}?id="  + $(this).attr("data-id");
            	  xadmin.open('弹窗消息',url,550,550);
              })
        	  $(".btnip").click(function() {
      			var ip = $(this).attr("data-ip");
      			 $.ajax({
      				    type: 'post',
      				    url: "{:url('ipforbid')}",
      				    dataType: "json",
      				    data: 'ip=' + ip,
      				    success: function(res) {
      				    	layer.msg(res.msg);
      				    }
      				});
      		  })              
          })
</script>
</head>
<body>
	<div class="x-nav">
		<span class="layui-breadcrumb">
			<a href="">首页</a>
			<a href="">订单管理</a>
			<a><cite>订单列表</cite></a>
		</span>
		<a class="layui-btn layui-btn-small" style="line-height: 1.6em; margin-top: 3px; float: right" onclick="location.reload()" title="刷新">
			<i class="layui-icon layui-icon-refresh" style="line-height: 30px"></i>
		</a>
	</div>
	<div class="layui-fluid">
		<div class="layui-row layui-col-space15">
			<div class="layui-col-md12">
				<div class="layui-card">
					<div class="layui-card-body ">
						<form class="layui-form layui-col-space5" method="post">
							<div class="layui-input-inline layui-show-xs-block">
								<input class="layui-input" placeholder="开始日" name="start" id="start">
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<input class="layui-input" placeholder="截止日" name="end" id="end">
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<select name="type">
									<option value='1'>按订单号</option>
								</select>
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<select name="status">
									<option value="">订单状态</option>
									<option value="0">处理中</option>
									<option value="1">成功</option>
									<option value="2">失败</option>
								</select>
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<input type="text" name="kw" placeholder="请输入" autocomplete="off" class="layui-input">
							</div>
							<div class="layui-input-inline layui-show-xs-block">
								<button class="layui-btn" lay-submit="" lay-filter="sreach">
									<i class="layui-icon">&#xe615;</i>
								</button>
							</div>
							{eq name="Request.param.refresh" value="1"}
							<div class="layui-input-inline layui-show-xs-block">
								<a class="layui-btn" href="{:url('',array('refresh'=>0))}">关闭刷新</a>
							</div>
							{else}
							<div class="layui-input-inline layui-show-xs-block">
								<a class="layui-btn" href="{:url('',array('refresh'=>1))}">开启刷新</a>
							</div>
							{/eq}
						</form>
					</div>
					<div class="layui-card-body ">
						<table class="layui-table layui-form">
							<thead>
								<tr>
								    <th>订单号</th>
									<th>转账用户id</th>
									<th>转账用户账号</th>									
									<th>转账金额</th>
									<th>收款用户id</th>
									<th>收款用户账号</th>									
									<th>订单时间</th>
									<th>状态</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								{volist name="data->items()" id="vo"}
								<tr>
								    <td>{$vo.order_id}</td>
									<td>{$vo.user_id}</td>
									<td>{$vo.user_name}</td>									
									<td>{$vo.money}</td>
									<td>{$vo.receive_uid}</td>
									<td>{$vo.receive_username}</td>
									<td>{$vo.create_time|date='Y-m-d H:i:s'}</td>
									<td>
									   {eq name="vo.status" value="0"}<span class="layui-btn layui-btn-disabled">审核中</span>{/eq}
									   {eq name="vo.status" value="1"}<span class="layui-btn">通过</span>{/eq}
                                       {eq name="vo.status" value="2"}<span class="layui-btn layui-btn-normal layui-btn-danger">失败</span>{/eq}								
									</td>
									<td class="td-manage">
										<a title="查看" href="javascript:void(0);" onclick="xadmin.open('编辑','{:url("info",array("id"=> $vo["order_id"]))}')"  class="layui-btn">查看</a>
										<a title="删除" onclick="remove_del(this,'{:url("del",array("id"=>$vo['order_id']))}')" href="javascript:void(0);" class="layui-btn layui-btn-normal">删</a>
									</td>
								</tr>
								{/volist}
							</tbody>
						</table>
					</div>
					<div class="layui-card-body">
						<div class="page">
							<div class="page">{$data->render()|raw}</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<include file="Public/footer" />
	</div>
</body>
<script>
       layui.use(['laydate', 'form'],
        function() {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });
     </script>
</html>